﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Entities
{
	public class SmartlistCriteria
	{
		private string field;
		private string condition;
		private string value;
		private string _operator;

		public string Field
		{
			get { return field; }
			set { field = value; }
		}

		public string Condition
		{
			get { return condition; }
			set { condition = value; }
		}

		public string Value
		{
			get { return this.value; }
			set { this.value = value; }
		}

		public string Operator
		{
			get { return _operator; }
			set { _operator = value; }
		}

		public static List<String> GetFields()
		{
			List<String> collection = new List<String>();

			collection.Add("Title");
			collection.Add("Genre");
			collection.Add("Director");
			collection.Add("Year");
			collection.Add("Rating");

			return collection;
		}

		public static List<String> GetConditions(string field)
		{
			List<String> collection = new List<String>();

			switch (field)
			{
				case "Director":
				case "Title":
				case "Genre":
					collection.Add("contains");
					collection.Add("does not contain");
					collection.Add("is");
					collection.Add("is not");
					break;
				case "Year":
					collection.Add("on");
					collection.Add("not on");
					collection.Add("before");
					collection.Add("after");
					break;
				case "Rating":
					collection.Add("greater");
					collection.Add("less");
					collection.Add("equals");
					break;
			}

			return collection;
		}
	}
}
